import { useStore } from "vuex";
import { State } from "../store";
import { Getters, Dispatch } from "../store/utils";

interface UseYdStore {
  state: State;
  getters: Getters;
  dispatch: Dispatch;
}

const useYdStore = (): UseYdStore => {
  const store = useStore<State>();
  // return store;
  // 自定义的进行输出结果
  const { state, getters, dispatch }: UseYdStore = store;
  return {
    state,
    getters,
    dispatch,
  };
};
export { useYdStore };
export default useYdStore;
